package edu.wong.service.impl;

import edu.wong.entities.Pay;
import edu.wong.mapper.AccountMapper;
import edu.wong.service.AccountService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountMapper accountMapper;
    @Override
    public int add(Pay account) {
        return accountMapper.insertSelective(account);
    }

    @Override
    public int delete(Integer id) {
        return accountMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Pay pay) {
        return accountMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay getById(Integer id) {
        return accountMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Pay> getAll() {
        return accountMapper.selectAll();
    }
}
